<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>低碳资讯</title>
    <link th:href="@{/css/bootstrap.css}" rel="stylesheet">
    <link th:href="@{/css/article/articleList.css}" rel="stylesheet">
</head>
<body>
    <button class="btn btn-primary form-control" style="height:50px"><a th:href="@{'/view/insert'}">添加资讯</a></button>
    <form th:action="@{/logout}" th:method="post">
        <button class="btn btn-primary form-control" style="height:50px">退出登录</button>
    </form>
    <table class="table table-striped table-bordered table-hover text-center">
        <thead>
        <tr style="text-align:center">
            <th>资讯ID</th>
            <th>标题</th>
            <th>描述</th>
            <th>资讯内容</th>
            <th>发布状态</th>
            <th>创建人</th>
            <th>创建时间</th>
            <th>更新人</th>
            <th>更新时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="article:${articleList}">
            <td th:text="${article.articleId}"></td>
            <td th:text="${article.title}"></td>
            <td th:text="${article.description}"></td>
            <td th:text="${article.content}"></td>
            <td th:if="${article.publish}">已发布</td>
            <td th:if="${not article.publish}">未发布</td>
            <td th:text="${article.createUser}"></td>
            <td th:text="${article.createTime}"></td>
            <td th:text="${article.updateUser}"></td>
            <td th:text="${article.updateTime}"></td>
            <td>
                <a class="btn btn-primary" th:href="@{'/view/edit/'+${article.articleId}}">更改</a>
                <a class="btn btn-danger" th:href="@{'/carbon/delete/'+${article.articleId}}">删除</a>
            </td>
        </tr>
        </tbody>
    </table>
</body>
</html>